require 'find'
@f = File.new("c:\\1.txt", "w")
Find.find("G:\\EpiDev\\JmCardG4") do |filename|
	if filename.match(/.pas$|.dfm$/) then
		File.open(filename, "r") do |file|
			@LineCount = 0
			@NamePuted = false
			while line = file.gets
				@LineCount = @LineCount + 1
				if line.match(/"FIsAdult"/) and not line.match(/COALESCE\((New.)?("chChild".)?"FIsAdult"/i) then
					if not @NamePuted then
						puts ' '
						@f.puts ' '
						puts filename
						@f.puts filename
					end
					@NamePuted = true
					puts "#{@LineCount} " + line
					@f.puts "#{@LineCount} " + line
				end
			end
		end
	end
end
@f.close
